#include "StdAfx.h"
#include "SubCableTying.h"
#include <SubCableTyingDisObj.h>


CSubCableTying::CSubCableTying(void)
{
}


CSubCableTying::~CSubCableTying(void)
{
}

void CSubCableTying::Serialize( CArchive & ar )
{
	if (ar.IsStoring())
	{
		int nSize= m_lstAssoSubcableCode.size();
		ar << nSize;
		for (list<CString>::iterator iter = m_lstAssoSubcableCode.begin();iter!= m_lstAssoSubcableCode.end();iter++)
		{
			CObj::WriteString(ar,*iter);
		}
	}
	else
	{
		int nSize=0;
		ar >> nSize;
		for (int n=0;n!= nSize;n++)
		{
			CString sTemp;
			CObj::ReadString(ar,sTemp);
			m_lstAssoSubcableCode.push_back(sTemp);
		}
	}

	CEntityObj::Serialize(ar);
}

CDisplayObj * CSubCableTying::CreateDisplayObj( long lLayerId )
{
	CSubCableTyingDisObj* pTyingDis = new CSubCableTyingDisObj(this);
	pTyingDis->SetLayerId(lLayerId);

	return pTyingDis;
}
